/*
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2023-11-23 09:45:23
 * @LastEditors: huangtianyang
 * @LastEditTime: 2024-04-07 17:05:57
 * @FilePath: \cxl-driving-training\src\apis\class\index.ts
 */
import axios from '../../axios/index'

export interface classListInterface {
    className?: string
    classType?: number
    current?: number
    disable?: number
    size?: number
    schoolId?: string
    vehicleType?: number //车辆类型（1.小车；2.摩托车; 3.无人机）
}
//班级列表
export const classList = (params: classListInterface) => {
    return axios({
        method: 'get',
        url: '/api/system/class/manage/getPageList',
        params
    })
}

export interface classTagListInterface {
    tag?: string //标签说明
    msg?: string //标签名称
    pic?: string //图片
    cover?: string //视频封面
    video?: string //视频
}

export interface classOperationInterface {
    advertisePic?: string //宣传图片
    advertiseTag?: string //宣传标签
    classFeatureList?: string[] //班级特色
    className?: string //班级名称
    classPicList?: string[] //班别图片
    classTagList?: classTagListInterface[] //班别标签
    classType?: number //班级类型
    courseContent?: string //课程内容
    feeList?: string //费用清单
    id?: string
    refundIntroduce?: string //退款说明
    signUpMsg?: string //报名情况
    studyFlow?: string //学习流程
    vehicleType?: number //车辆类型（1.小车；2.摩托车; 3.无人机）
    classExplain?: classTagListInterface[] //班别说明
    classNumber?: string //班别编号
    classPic?: classTagListInterface[] //	班别图片
    classTag?: string[] //	班别标签
    classVideo?: classTagListInterface[] //班别视频
    classVideoIntroduce?: string //班别视频介绍
    finishCycle?: number //最快毕业周期（1.60天，2.135天，3.215天）
    refundExplain?: string //退款说明
    schoolId?: string //驾校id
}

//班级详情
export const classDetailed = (id: string) => {
    return axios({
        method: 'get',
        url: '/api/system/class/manage/detailById',
        params: { id }
    })
}
//新增班级
export const addClass = (data: classOperationInterface) => {
    return axios({
        method: 'post',
        url: '/api/system/class/manage/add',
        data
    })
}

//编辑班级
export const editClass = (data: classOperationInterface) => {
    return axios({
        method: 'post',
        url: '/api/system/class/manage/edit',
        data
    })
}
/**
 * 启用/禁用
 * @param disable 0.可用；1.禁用
 * @param id
 * @returns
 */
export const classDisable = (disable: number, id: string) => {
    return axios({
        method: 'post',
        url: '/api/system/class/manage/updateDisable',
        data: { disable, id }
    })
}
